Optimal. Leaf size=58 \[ \frac{2 (b+c) \tan ^{-1}\left (\frac{\sqrt{a-b} \tan \left (\frac{x}{2}\right )}{\sqrt{a+b}}\right )}{\sqrt{a-b} \sqrt{a+b}}-\frac{\log (a+b \cos (x))}{b} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.114686, antiderivative size = 58, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 5, integrand size = 14, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.357, Rules used = {4401, 2659, 205, 2668, 31} \[ \frac{2 (b+c) \tan ^{-1}\left (\frac{\sqrt{a-b} \tan \left (\frac{x}{2}\right )}{\sqrt{a+b}}\right )}{\sqrt{a-b} \sqrt{a+b}}-\frac{\log (a+b \cos (x))}{b} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4401
Rule 2659
Rule 205
Rule 2668
Rule 31
Rubi steps
\begin{align*} \int \frac{b+c+\sin (x)}{a+b \cos (x)} \, dx &=\int \left (\frac{b+c}{a+b \cos (x)}+\frac{\sin (x)}{a+b \cos (x)}\right ) \, dx\\ &=(b+c) \int \frac{1}{a+b \cos (x)} \, dx+\int \frac{\sin (x)}{a+b \cos (x)} \, dx\\ &=-\frac{\operatorname{Subst}\left (\int \frac{1}{a+x} \, dx,x,b \cos (x)\right )}{b}+(2 (b+c)) \operatorname{Subst}\left (\int \frac{1}{a+b+(a-b) x^2} \, dx,x,\tan \left (\frac{x}{2}\right )\right )\\ &=\frac{2 (b+c) \tan ^{-1}\left (\frac{\sqrt{a-b} \tan \left (\frac{x}{2}\right )}{\sqrt{a+b}}\right )}{\sqrt{a-b} \sqrt{a+b}}-\frac{\log (a+b \cos (x))}{b}\\ \end{align*}
Mathematica [A] time = 0.0729495, size = 57, normalized size = 0.98 \[ -\frac{2 (b+c) \tanh ^{-1}\left (\frac{(a-b) \tan \left (\frac{x}{2}\right )}{\sqrt{b^2-a^2}}\right )}{\sqrt{b^2-a^2}}-\frac{\log (a+b \cos (x))}{b} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.02, size = 150, normalized size = 2.6 \begin{align*}{\frac{1}{b}\ln \left ( \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{2}+1 \right ) }-{\frac{a}{b \left ( a-b \right ) }\ln \left ( \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{2}a- \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{2}b+a+b \right ) }+{\frac{1}{a-b}\ln \left ( \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{2}a- \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{2}b+a+b \right ) }+2\,{\frac{b}{\sqrt{ \left ( a+b \right ) \left ( a-b \right ) }}\arctan \left ({\frac{ \left ( a-b \right ) \tan \left ( x/2 \right ) }{\sqrt{ \left ( a+b \right ) \left ( a-b \right ) }}} \right ) }+2\,{\frac{c}{\sqrt{ \left ( a+b \right ) \left ( a-b \right ) }}\arctan \left ({\frac{ \left ( a-b \right ) \tan \left ( x/2 \right ) }{\sqrt{ \left ( a+b \right ) \left ( a-b \right ) }}} \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.18665, size = 539, normalized size = 9.29 \begin{align*} \left [-\frac{\sqrt{-a^{2} + b^{2}}{\left (b^{2} + b c\right )} \log \left (\frac{2 \, a b \cos \left (x\right ) +{\left (2 \, a^{2} - b^{2}\right )} \cos \left (x\right )^{2} + 2 \, \sqrt{-a^{2} + b^{2}}{\left (a \cos \left (x\right ) + b\right )} \sin \left (x\right ) - a^{2} + 2 \, b^{2}}{b^{2} \cos \left (x\right )^{2} + 2 \, a b \cos \left (x\right ) + a^{2}}\right ) +{\left (a^{2} - b^{2}\right )} \log \left (b^{2} \cos \left (x\right )^{2} + 2 \, a b \cos \left (x\right ) + a^{2}\right )}{2 \,{\left (a^{2} b - b^{3}\right )}}, \frac{2 \, \sqrt{a^{2} - b^{2}}{\left (b^{2} + b c\right )} \arctan \left (-\frac{a \cos \left (x\right ) + b}{\sqrt{a^{2} - b^{2}} \sin \left (x\right )}\right ) -{\left (a^{2} - b^{2}\right )} \log \left (b^{2} \cos \left (x\right )^{2} + 2 \, a b \cos \left (x\right ) + a^{2}\right )}{2 \,{\left (a^{2} b - b^{3}\right )}}\right ] \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.18613, size = 146, normalized size = 2.52 \begin{align*} -\frac{2 \,{\left (\pi \left \lfloor \frac{x}{2 \, \pi } + \frac{1}{2} \right \rfloor \mathrm{sgn}\left (-2 \, a + 2 \, b\right ) + \arctan \left (-\frac{a \tan \left (\frac{1}{2} \, x\right ) - b \tan \left (\frac{1}{2} \, x\right )}{\sqrt{a^{2} - b^{2}}}\right )\right )}{\left (b + c\right )}}{\sqrt{a^{2} - b^{2}}} - \frac{\log \left (-a \tan \left (\frac{1}{2} \, x\right )^{2} + b \tan \left (\frac{1}{2} \, x\right )^{2} - a - b\right )}{b} + \frac{\log \left (\tan \left (\frac{1}{2} \, x\right )^{2} + 1\right )}{b} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]